package com.example.jetpack_databinding.main2

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.example.jetpack_databinding.R
import com.example.jetpack_databinding.databinding.ActivityMain2Binding
import com.example.jetpack_databinding.main1.Person

class MainActivity2 : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        var activityMain2Binding: ActivityMain2Binding =
            DataBindingUtil.setContentView<ActivityMain2Binding>(this, R.layout.activity_main2)
        val person = Person("张三", 22)
        activityMain2Binding.person=person
    }
}